package com.example.redistest.redislocktest;

/**
 * \* @author: wky
 * \* Date: 2023-04-20
 * \* Time: 14:23
 * \* To change this template use File | Settings | File Templates.
 * \* Description:CommonLockResourceService
 * \
 */
public interface CommonLockResourceService {

    /**
     * 获得锁
     * @param resourceKeyPrefix 锁的redis前缀
     * @param resourceId 资源id
     * @param userId 用户id
     * @return
     */
    boolean getLock(String resourceKeyPrefix,int resourceId,int userId);


    //释放锁
    boolean unLock(String resourceKeyPrefix,int resourceId,int userId);

    //锁延期
    boolean resetLock(String resourceKeyPrefix,int resourceId, int userId);

}